const router = require('express').Router()
const db = require('../common/db')
const modul = require('../model/examMoudul')


// http://localhost:4000/api/exam/add
router.post('/add', async (req, res) => {
    let c_id = req.body.c_id;
    if (c_id) {
        await modul.add(c_id)
            .then(
                data => {
                    res.send(data)
                }
            )
            .catch(
                err => {
                    res.send(err)
                }
            )
    } 
    else {
        res.send({
            code: -1,
            msg: '缺少参数'
        })
    }
});

// 导出路由
module.exports = router;